import java.io.*;
import java.net.*;

class MyClient {
    private static final int SOCKET = 11234;
    private static final String QUIT = "quit";

    public static void main(String args[]) {
        Socket server = null;
        try {
            server = new Socket(InetAddress.getLocalHost(), SOCKET);
            PrintWriter out = new PrintWriter(server.getOutputStream());
            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
            while (true) {
                String command = stdin.readLine();
                out.println(command);
                out.flush();
                if (QUIT.equals(command)) {
                    break;
                }
            }
            server.close();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        }
    }
}
